﻿using System;

namespace AvalonDockSample.ViewModels
{
    public class TextDocumentViewModel : DocumentViewModel
    {
        public TextDocumentViewModel()
        {
            Title = "文本文档";
            ContentId = Guid.NewGuid().ToString();
        }

        private string _content = "请输入文本内容...";
        public string Content
        {
            get => _content;
            set
            {
                if (_content != value)
                {
                    _content = value;
                    RaisePropertyChanged(nameof(Content));
                    //OnPropertyChanged();
                    Title = $"文本文档{(string.IsNullOrEmpty(value) ? "" : "*")}";
                }
            }
        }
    }
}